

$(function () {
    $.ajax({
        type: "GET",
        url: urlcore + "/api/systemParm/selectOne?id=1",
        dataType: "json",
        contentType: "application/json;charset=UTF-8",
        data: {},
        success: function (data) {
            $("#fx").val((data.data.cashBackPoundage*100).toFixed(0));
            $("#tx").val((data.data.withdrawCashPoundage*100).toFixed(0));
            $("#centurionRate").val((data.data.centurionRate*100).toFixed(0));
            $("#chiliarchRate").val((data.data.chiliarchRate*100).toFixed(0));
            $("#franchiseeRate").val((data.data.franchiseeRate*100).toFixed(0));
            $("#rainbowPrice").val((data.data.rainbowPrice).toFixed(0));
        },
        error: function () {
            alert("失败");
        }
    });

});




//添加商品
function update(){
    if($("#fx").val()<1||$("#tx").val()<1){
        alert("所有比率百分比数值不能小于1，请检查")
        return;
    }
	    $.ajax({
        type: "POST",
        url: urlcore + "/api/systemParm/update",
        dataType: "json",
        contentType: "application/json;charset=UTF-8",
        data:JSON.stringify({
            id:1,
            cashBackPoundage:$("#fx").val()/100,
            withdrawCashPoundage:$("#tx").val()/100,
            centurionRate:$("#centurionRate").val()/100,
            chiliarchRate:$("#chiliarchRate").val()/100,
            franchiseeRate:$("#franchiseeRate").val()/100,
            rainbowPrice:$("#rainbowPrice").val()
        }),
        success: function (data) {
            alert("保存成功");
            $table.bootstrapTable('refresh');
        },
        error: function () {
            alert("失败");
        }
    });

	
	
	
}

window.onload = function(){


}